On the Welcome to PyCharm screen, press the button.
In the New Project dialog, leave all settings at their defaults, and press the button.
If prompted by PyCharm, allow the Microsoft Defender configuration by pressing the
button, and further allowing PyCharm to make corresponding changes to the system.Switch to the Terminal window of PyCharm, type pip install opclabs_quickopc, and press Enter. Wait until the package is fully installed.
From the PyCharm menu, select New menu, select .
-> , and then in theIn the New Python file window, type in hello for the Name, and press Enter.
In the hello.py editor tab, add following code:
import opclabs_quickopc from OpcLabs.EasyOpc.UA import * client = EasyUAClient() value = IEasyUAClientExtension.ReadValue(client, UAEndpointDescriptor('opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'), UANodeDescriptor('nsu=http://test.org/UA/Data/;i=10853')) print(value)
Select Shift+F10) from the PyCharm menu, or press the corresponding button (green right-pointing hollow triangle) on the PyCharm toolbar.
-> (This will build and launch the program. The value will be read from the OPC server and displayed in the Debug Console window.
This Getting Started is for OPC "Classic" (COM/DCOM based). It is supported only on Windows and works with the simulation server installed with OPC Data Client Setup program.
On the Welcome to PyCharm screen, press the button.
In the New Project dialog, leave all settings at their defaults, and press the button.
If prompted by PyCharm, allow the Microsoft Defender configuration by pressing the
button, and further allowing PyCharm to make corresponding changes to the system.Switch to the Terminal window of PyCharm, type pip install opclabs_quickopc, and press Enter. Wait until the package is fully installed.
From the PyCharm menu, select New menu, select .
-> , and then in theIn the New Python file window, type in helloDA for the Name, and press Enter.
In the helloDA.py editor tab, add following code:
import opclabs_quickopc from OpcLabs.EasyOpc.DataAccess import * client = EasyDAClient() value = IEasyDAClientExtension.ReadItemValue(client, '', 'OPCLabs.KitServer.2', 'Demo.Single') print(value)
Select Shift+F10) from the PyCharm menu, or press the corresponding button (green right-pointing hollow triangle) on the PyCharm toolbar.
-> (This will build and launch the program. The value will be read from the OPC server and displayed in the Debug Console window.
On the Welcome to PyCharm screen, press the button.
In the New Project dialog, leave all settings at their defaults, and press the button.
If prompted by PyCharm, allow the Microsoft Defender configuration by pressing the
button, and further allowing PyCharm to make corresponding changes to the system.Switch to the Terminal window of PyCharm, type pip install opclabs_quickopc, and press Enter. Wait until the package is fully installed.
From the PyCharm menu, select New menu, select .
-> , and then in theIn the New Python file window, type in helloXml for the Name, and press Enter.
In the helloXml.py editor tab, add following code:
import opclabs_quickopc from OpcLabs.EasyOpc import * from OpcLabs.EasyOpc.DataAccess import * client = EasyDAClient() value = IEasyDAClientExtension.ReadItemValue(client, ServerDescriptor('http://opcxml.demo-this.com/XmlDaSampleServer/Service.asmx'), DAItemDescriptor('Dynamic/Analog Types/Double')) print(value)
Select Shift+F10) from the PyCharm menu, or press the corresponding button (green right-pointing hollow triangle) on the PyCharm toolbar.
-> (This will build and launch the program. The value will be read from the OPC server and displayed in the Debug Console window.